package cn.codergege.kotlinclass.ktdelegate

interface Drivable {
    fun drive()
}

class Driver: Drivable {
    override fun drive() = println("Driver driving ...")
}

class OlderDriver: Drivable {
    override fun drive() {
        println("老司机开车...")
    }
}

class Manager(val driver: Drivable): Drivable by driver

fun main(args: Array<String>) {
    Manager(Driver()).drive() // Driver driving ...
    Manager(OlderDriver()).drive() // 老司机开车...
}

